// pages/userInfo/userInfo.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    ListData: null,
    componentState: false //组件的data
  },
  ListData: {
    cells: [{
      iconPath: "http://image1.sansancloud.com/sansancloud/2018_9/11/14/41/49_530.jpg",
      linkUrl: "order_pintuan.html?payStatus=1&orderType=12",
      text: "我的拼单",
      color: "#777777"
    },
    {
      iconPath: "http://image1.sansancloud.com/xianhua/2018_10/9/14/16/9_477.jpg",
      linkUrl: "user_jifen_events.html",
      text: "我的积分",
      color: "#777777"
    },
    {
      iconPath: "http://image1.sansancloud.com/xianhua/2018_10/9/14/10/49_366.jpg",
      linkUrl: "my_coupons.html",
      text: "我的优惠券",
      color: "#777777"
    },
    {
      iconPath: "http://image1.sansancloud.com/xianhua/2019_1/4/11/7/54_534.jpg",
      linkUrl: "my_card_voucher.html",
      text: "我的卡券",
      color: "#777777"
    },
    {
      iconPath: "http://image1.sansancloud.com/xianhua/2019_1/11/20/49/36_852.jpg",
      linkUrl: "verification_record.html",
      text: "核销记录",
      color: "#777777"
    },
    {
      iconPath: "http://image1.sansancloud.com/xianhua/2018_9/5/16/54/39_501.jpg",
      linkUrl: "address.html",
      text: "收货地址",
      color: "#777777"
    },
    {
      iconPath: "http://image1.sansancloud.com/xianhua/2018_9/5/16/52/10_637.jpg",
      linkUrl: "yijian_fankui.html",
      text: "意见反馈",
      color: "#777777"
    },
    {
      iconPath: "http://image1.sansancloud.com/xianhua/2018_9/5/16/45/22_284.jpg",
      linkUrl: "custom_page_about_us?pageNage=关于我们",
      text: "关于我们",
      color: "#777777"
    },
    ],
    column: 3,
    showType: 0
  },
  dellSData: function () {
    this.setData({
      ListData: this.ListData
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let self = this
    wx.getSetting({//检查用户是否授权了
      success(res) {
        console.warn("======检查用户是否授权了========", res)
        if (!res.authSetting['scope.userInfo']) {
          console.log('=====没授权====')
        } else {
          console.log('=====已授权====')
          self.dellSData()
        }
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },
  showPoster () {
    wx.showModal({
      title: '提示',
      content: '您还未登录，点击【确定】重新加载',
      success: function (res) {
      }
    })
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },
  login: function () {
    wx.showModal({
      title: '提示',
      content: '点击了登陆操作',
      success(res) {
        if (res.confirm) {
          console.log('用户点击确定')
        } else if (res.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})